#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int mod=998244353,inf=0x3f3f3f3f3f3f3f3f;
int a[10][10],b[10][10],c[10][10];
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	int n=3;
	for ( int i = 1 ; i <= n ; i++ )for ( int j = 1 ; j <= n ; j++ )cin >> a[i][j];
	for ( int i = 1 ; i <= n ; i++ )for ( int j = 1 ; j <= n ; j++ )cin >> b[i][j];
	for ( int i = 1 ; i <= n ; i++ )
	{
		for ( int j = 1 ; j <= n ; j++ )
		{
			for ( int k = 1 ; k <= n ; k++ )c[i][j]+=a[i][k]*b[k][j];
			cout << c[i][j]%2 << " ";
		}
		cout << endl;
	}
	return 0;
}


